package com.aihna.mall.domain.bo;

import com.aihna.mall.domain.StoreProductAttrValue;
import com.aihna.common.core.validate.AddGroup;
import com.aihna.common.core.validate.EditGroup;
import com.aihna.common.mybatis.core.domain.BaseEntity;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;

/**
 * 商品属性值业务对象 vvl_store_product_attr_value
 *
 * @author Joseph.Chen
 * @date 2024-03-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = StoreProductAttrValue.class, reverseConvertGenerate = false)
public class StoreProductAttrValueBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 商品ID
     */
    @NotNull(message = "商品ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long productId;

    /**
     * 商品属性索引值 (attr_value|attr_value[|....])
     */
    @NotBlank(message = "商品属性索引值 (attr_value|attr_value[|....])不能为空", groups = { AddGroup.class, EditGroup.class })
    private String sku;

    /**
     * 图片
     */
    @NotBlank(message = "图片不能为空", groups = { AddGroup.class, EditGroup.class })
    private String image;

    /**
     * 商品价格
     */
    @NotNull(message = "商品价格不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal price;

    /**
     * 成本价
     */
    @NotNull(message = "成本价不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal costPrice;

    /**
     * 市场价
     */
    @NotNull(message = "市场价不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal otPrice;

    /**
     * 商品条码
     */
    @NotBlank(message = "商品条码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String barCode;

    /**
     * 属性对应的库存
     */
    @NotNull(message = "属性对应的库存不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer stock;

    /**
     * 销量
     */
    private Integer sales;

    /**
     * 重量
     */
    @NotNull(message = "重量不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal weight;

    /**
     * 体积
     */
    @NotNull(message = "体积不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal volume;

    /**
     * 一级返佣
     */
    @NotNull(message = "一级返佣不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal firstBrokeragePrice;

    /**
     * 二级返佣
     */
    @NotNull(message = "二级返佣不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal secondBrokeragePrice;

    /**
     * 活动类型 0=商品，1=秒杀，2=砍价，3=拼团
     */
    @NotNull(message = "活动类型 0=商品，1=秒杀，2=砍价，3=拼团不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer type;

    /**
     * 活动限购数量
     */
    private Long quota;

    /**
     * 活动限购数量显示
     */
    private Long quotaShow;

    /**
     * attr_values 创建更新时的属性对应
     */
    @NotBlank(message = "attr_values 创建更新时的属性对应不能为空", groups = { AddGroup.class, EditGroup.class })
    private String attrValue;


}
